package lulin.w09.service;

import lulin.w09.dao.DepartmentDaoInterface;
import lulin.w09.entity.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentService implements DepartmentServiceInterface {

    @Autowired
    private DepartmentDaoInterface departmentDao;

    @Override
    public Long addDepartment(Department department) {
        return departmentDao.addDepartment(department);
    }

    @Override
    public int deleteDepartment(Long id) {
        return departmentDao.deleteDepartment(id);
    }

    @Override
    public int updateDepartment(Department department) {
        return departmentDao.updateDepartment(department);
    }

    @Override
    public Department getDepartment(Long id) {
        return departmentDao.getDepartment(id);
    }

    @Override
    public List<Department> getAllDepartments() {
        return departmentDao.getAllDepartments();
    }

    @Override
    public List<Department> getDepartmentsBySchoolId(Long schoolId) {
        return departmentDao.getDepartmentsBySchoolId(schoolId);
    }
}    